package views
{
	import inerface.INewsDetailPanel;
	
	import main.ViewSubBase;
	
	import panel.newsDetail.NewsDetailPanel;
	
	public class NewsDetailView extends ViewSubBase
	{
		private var _panel:INewsDetailPanel;
		
		private var news:Object;
		
		public function NewsDetailView()
		{
		}
		
		public function set info(obj:Object):void
		{
			news = obj;
		}
		
		public override function show():void
		{
			render();
		}
		
		protected override function render():void
		{
			if(_panel == null){
				_panel = new NewsDetailPanel;
				_panel.init(view.layout.stage,view.resourceLoader,view.lang,view.uri);
				
			}
			_panel.changeData(news);
			
			this.addView(_panel);
		}
		
		public override function clear():void
		{
			_panel.clear();
			_panel = null;
		}
		
		public override function close():void
		{
			closeView(this);
		}
	}
}